package com.mark.entity;

import com.mark.enums.OrderStatusEnum;
import com.mark.enums.PayStatusEnum;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created by Choisaaaa on 2018/6/21.
 * 订单实体类
 */

@Entity
@Data
@DynamicUpdate
public class OrderMaster {

    @Id
    private String orderId;                                       //订单ID
    private String buyerName;                                     //订单名称
    private String buyerPhone;                                    //买家手机号
    private String buyerAddress;                                  //买家地址
    private String buyerOpenid;                                   //买家微信号
    private BigDecimal orderAmount;                               //订单总价
    private Integer orderStatus = OrderStatusEnum.NEW.getCode();  //订单状态
    private Integer payStatus = PayStatusEnum.WAIT.getCode();     //订单的支付状态
    private Date createTime;                                      //订单的创建时间
    private Date updateTime;                                      //订单的更新时间

    //下面的属性扩展为DTO层数据
    //@Transient
    //private List<OrderDetail> orderDetailList;                    //订单子明细

}
